#include "RepositorioInputs.h"

RepositorioInputs* RepositorioInputs::_instance=NULL;

RepositorioInputs::RepositorioInputs(){
	for(int c=0;c<MAX_INPUT_ID;c++){
		this->inputs[c]=false;
	}
}


RepositorioInputs* RepositorioInputs::instance(){
	if(RepositorioInputs::_instance==NULL){
		RepositorioInputs::_instance=new RepositorioInputs();
	}
	return RepositorioInputs::_instance;
}

bool RepositorioInputs::checkInput(unsigned int id){
	if(id > MAX_INPUT_ID )
		return false;
	return this->inputs[id];
}

void RepositorioInputs::registraInput(unsigned int id){
	this->inputs[id]=true;
}

bool RepositorioInputs::checkAnyInput(){
	for(int c=0;c<MAX_INPUT_ID;c++){
		if(this->inputs[c]){
			return true;
		}
	}
	return false;
}

void RepositorioInputs::desRegistraInput(unsigned int id){
	this->inputs[id]=false;
}
